using SimpleGraphQLDemo.WebApi.GraphFieldMiddlewares;
using SimpleGraphQLDemo.WebApi.GraphTypes.Orders.Queries;
using SimpleGraphQLDemo.WebApi.GraphTypes.Products.Queries;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGraphQLServer()
    .AddQueryType()
    .AddTypeExtension<OrderQueryResolver>()
    .AddTypeExtension<OrderExtendQueryResolver>()
    .AddTypeExtension<ProductQueryResolver>()
    .AddTypeExtension<ProductExtendQueryResolver>()
    .AddTypeExtension<ProductItemLogExtendQueryResolver>()
    .UseField<FieldMiddleware>();

var app = builder.Build();
app.MapGraphQL();
app.Run();